package com.qianyu.project.web.controller.smj;

import com.qianyu.project.entity.ApplyLaborPayment;
import com.qianyu.project.entity.LaborContract;
import com.qianyu.project.service.smj.smjLaberApplyService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/smj_laber_apply")
public class smjLaberApplyController {
    @Autowired
    private smjLaberApplyService las;

    @GetMapping("")
    public String AddLaberApply(String apply_date,String payment_name,String type,String ctr_id,String p_id,String company_id,String contract_amount,String penalty,String withhold,String settle_type,String bank_id,String agree_amount,String handler_id,String agree_upper,String attach_ids,String settle_comment){
        return las.AddLaberApply( apply_date, payment_name, type, ctr_id, p_id, company_id, contract_amount, penalty, withhold, settle_type, bank_id, agree_amount, handler_id, agree_upper, attach_ids, settle_comment);
    }

    @PostMapping("/Flow_laberapply")
    public Integer FlowLaber(@RequestBody ApplyLaborPayment applyLaborPayment){
        return  las.FlowLaberApply(applyLaborPayment);
    }

    @GetMapping("/listLaberApply")
    public Result listLaberApply(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询合同
        map.put("data", las.listLaberApply(params));
        return ResultTool.success(map);
    }

    @GetMapping("/getfromaudit")
    public List<Map<String,Object>> getfromaudit(String id){
        return  las.getfromaudit(id);
    }
}
